<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/','HomeController@index');

Route::get('users', function()
{
    if (Auth::check())
    {
        return 'Users!';
    }
    else{
        App::abort(403, 'Unauthorized action.');
    }

});

Route::get('user/{name}', function($name)
{
    return $name;
})
 ->where('name', '[A-Za-z]+');

Route::any('nerds', 'NerdController');
//Route::group(array('before'=>'auth.basic'), function() {
    Route::controller('api/videos', 'VideosController');
    Route::controller('api/comments', 'CommentsController');
    Route::controller('api/likes', 'LikesController');
    Route::controller('api/profile', 'ProfileController');
    Route::controller('api/friendship', 'FriendshipController');
//});

Route::get('comment', function()
{
    return View::make('comments.comment');
});

//Event::listen('404', function()
//{
//    return Response::error('404');
//});
//
//Event::listen('403',function(){
//    App::abort(403, 'Unauthorized action.');
//});
//
//Event::listen('500', function()
//{
//    return Response::error('500');
//});